/*//////////////////////////////////////////////////////////////////////////////
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 2003-2008 Intel Corporation. All Rights Reserved.
//
*/

#include "umc_defs.h"
#if defined (UMC_ENABLE_MP3_INT_AUDIO_DECODER)

#ifndef __UMC_MP3_DEC_H__
#define __UMC_MP3_DEC_H__

#include "ipps.h"
#include "audio_codec_params.h"
#include "mp3_status.h"
#include "umc_audio_codec.h"
#include "vm_types.h"
#include "vm_debug.h"

/* /////////////////////////////////////////////////////////////////////////////
//  Class:       MP3Decoder
//
*/

struct _MP3Dec;

namespace UMC {

#define MP3_PROFILE_MPEG1  1
#define MP3_PROFILE_MPEG2  2

#define MP3_LEVEL_LAYER1   1
#define MP3_LEVEL_LAYER2   2
#define MP3_LEVEL_LAYER3   3

  class   MP3DecoderInt:public AudioCodec {
  public:
    MP3DecoderInt();
    virtual ~MP3DecoderInt();

    virtual Status  Init(BaseCodecParams * init);

    virtual Status  GetFrame(MediaData * in, MediaData * out);

    virtual Status  Close();
    virtual Status  Reset();

    virtual Status  GetInfo(BaseCodecParams * info);

    virtual Status  SetParams(BaseCodecParams * /* params */) {
      return UMC_ERR_NOT_IMPLEMENTED;
    };

    virtual Status  GetDuration(Ipp32f *p_duration);

  protected:
    struct _MP3Dec *state;
    cAudioCodecParams params;
    Ipp64f m_pts_prev;
    MemID  stateMemId;
    Ipp32s m_syncro_mode;
    Ipp32s m_initialized;

    Status StatusMP3_2_UMC(MP3Status st);
    Status MemLock();
    Status MemUnlock();
  };

}      // namespace UMC

#endif

#endif //UMC_ENABLE_MP3_INT_AUDIO_DECODER
